<!--
 * @Author: your name
 * @Date: 2021-04-25 15:07:41
 * @LastEditTime: 2021-04-25 19:47:53
 * @LastEditors: Please set LastEditors
 * @Description: In User Settings Edit
 * @FilePath: \Four\day8\src\views\About.vue
-->
<template>
  <div class="yuan">
    <div id="main"></div>
  </div>
</template>

<script>
import * as echarts from "echarts";

export default {
  mounted() {
    var chartDom = document.getElementById("main");
    var myChart = echarts.init(chartDom);
    var option;
    option = {
      title: {
        text: "阿呆呆不呆",
        // subtext: "纯属虚构",
        left: "center",
      },
      tooltip: {
        trigger: "item",
      },
      legend: {
        orient: "vertical",
        left: "left",
      },
      series: [
        {
          name: "访问来源",
          type: "pie",
          radius: "50%",
          data: [
            { value: 1900, name: "一线城市" },
            { value: 2100, name: "二线城市" },
            { value: 2700, name: "三线城市呆" },
            { value: 3300, name: "四线城市及以下" },
          ],
        },
      ],
    };

    option && myChart.setOption(option);
  },
};
</script>

<style>
.yuan {
  width: 100%;
  height: 100%;
}
#main {
  width: 1000px;
  height: 600px;
}
</style>